/** * 页面： * * @author zhiyong * @version 1.0.0 * @time 22/09/19 */
<template>
  <view :class="data.isNew ? 'comment-item new' : 'comment-item'">
    <image class="avatar" :src="data.userWxAvatar" />
    <view class="content" v-if="data !== null">
      <view class="name-good">
        <text class="name">{{ data.userName }}</text>
        <view class="good" @click="onCommentGoodClick">
          <image v-if="data.likedFlag" src="../../../static/images/icon-like-active.svg" />
          <image v-else src="../../../static/images/icon-like-gray.svg" />
          <text :class="data.likedFlag ? 'red' : ''">
            {{ data.likeCount > 0 ? formatBigNum(data.likeCount || 0) : '赞' }}
          </text>
        </view>
      </view>

      <view v-if="data.toFlag" class="reply-content">
        {{ data.toExistFlag ? `@${data.toUserName}：` : '' }}{{ data.toContent }}
      </view>
      <text class="text">{{ data.content }}</text>
      <view class="reply">
        <view v-if="hasOperator" class="btn" @click="onReply">
          {{
            data.commentReplyCount > 0 ? `${formatBigNum(data.commentReplyCount || 0)}条` : ''
          }}回复
        </view>
        <view class="time">
          {{ data.timeDescription }}
          {{
            data.ipAttribution
              ? `·
          ${data.ipAttribution}`
              : ''
          }}
        </view>
        <view v-if="hasOperator && data.belongFlag" class="delete" @click="deleteComment">
          删除
        </view>
      </view>
    </view>
  </view>
</template>

<script src="./index" lang="ts"></script>

<style lang="less">
@import './index.less';
</style>
